module.exports = {
  nav_name: '管理员设置', //生成导航菜单
  module_name: 'admin_manager',  //生成路径，与模块名相同
  api: `{
    page: commonPath + "/admin/sys/user/pageSearch", // 会员分页
    del: commonPath + "/admin/sys/user/delete", 
    add: commonPath + '/admin/sys/user/insert', //新增
    detail: commonPath + '/admin/sys/user/getDetail', //获取详情,
    edit: commonPath + "/admin/sys/user/update", //编辑

    role_page: commonPath + "/admin/sys/role/search",
    // changeState: commonPath + '/admin/user/modifyState', //会员状态编辑
  }`,
  table: {
    nav_name: "管理员列表",
    tipsText: "管理员设置 >> 管理员列表",
    //获取列表页面
    tableData: [
      { title: '序号', name: 'index', type: "normal" },
      { title: '账号', name: 'accountNo', type: "normal" },
      { title: '账户名', name: 'loginName', type: "normal", showObj: "{}" },
      {
        title: '身份',
        name: 'roleId',
        type: "opts",
        showName: "roleShow",
        showObj: `{}`
      },
    ],
    tableOpt: [
      // {
      //   type: "view",
      //   text: "查看",
      //   request: false,
      //   jump: "/member_manager/see_detail_member"
      // },
      {
        type: "modify",
        text: "编辑",
        request: false,
        jump: "/admin_manager_add_page"
      },
      // {
      //   type: "changeState",
      //   text: "加入黑名单",
      //   request: true,
      //   url: "API.member_manager.changeState",
      //   requestType: 'post',
      //   params: `{id,  state: 2 }`, //必须为文本
      //   methodNameTag: 'Black', //方法衔接拓展名
      // },
      {
        type: "del",
        text: "删除",
        request: true,
        url: "API.admin_manager.del",
        requestType: 'post',
        isSplitSearchString: "true", //是否拼接查询字符串在链接结尾
      },
      // {
      //   type: "changeState",
      //   text: "启用",
      //   request: true,
      //   url: "API.member_manager.del",
      //   requestType: 'post',
      //   params: `{ state: 1 }`,
      //   methodNameTag: 'Enable', //方法衔接拓展名 用于标志不同方法
      // },
    ],
    search: {
      contentArr: {
        input1: {
          labelName: '账户名', inputName: 'loginName'
        },
      },
      searchBtn: {
        text: "查询", //链接与table请求接口相同，不做另外配置
      },
      addBtn: {
        //搜索栏具有添加功能按钮时，设置此字段
        type: "add",
        text: "新增",
        request: false,
        jump: "/admin_manager_add_page", //后期设置成自动的
      }
    },
    //额外请求
    extraRequest: {
      dataCode: [
        "roleOpts"
      ],
      methodsCode: [
        {
          explainText: "管理员角色获取", //说明
          type: "opts&&shows",  //表示选项类型格式，value, label
          methodName: "getRoleData",
          api: "API.admin_manager.role_page",
          optsName: "roleOpts",
          showName: "roleShow",
          params: `{
            "pageIndex": 1,
            "pageSize": 100,
          }`,
          optsConfig: {
            label: "roleName",
            value: "id"
          },
          showConfig: {
            key: "id",
            value: "roleName"
          },
        }
      ]
    },
  },


  //添加页面
  add_page: {
    isGenerate: 'false',
    tipsText: "管理员设置 >> 管理员",
    formData: {
      titleText: "请填写管理员相关信息",
      //三种类型，输入，下拉，图片上传
      input1: {
        labelName: '账号',
        inputName: 'accountNo',
        isNeed: 'true',
      },
      input2: {
        labelName: '账号名',
        inputName: 'loginName',
        isNeed: 'true',
      },
      input3: {
        labelName: '密码',
        inputName: 'pwd',
        isNeed: 'true'
      },
      input4: {
        labelName: '确认密码',
        inputName: 'comfirmPwd',
        isNeed: 'true'
      },
      select1: {
        labelName: '身份',
        inputName: 'roleId',  //输入绑定的变量
        selectOptsName: "roleOpts",
        selectOptsArr: `[],
          `, //选项数组
      },
      // //图片上传
      // uploadImg1: {
      //   labelName: "轮播图上传",
      //   inputName: "img",
      // },
      // //三级联动组件
      // address1: {
      //   label: "地址选择",
      //   inputName: "",
      // }
    },
    //额外请求
    extraRequest: {
      dataCode: [
        "roleOpts"
      ],
      methodsCode: [
        {
          explainText: "管理员角色获取", //说明
          type: "opts",  //表示选项类型格式，value, label
          methodName: "getRoleData",
          api: "API.admin_manager.role_page",
          optsName: "roleOpts",
          params: `{
            "pageIndex": 1,
            "pageSize": 100,
          }`,
          optsConfig: {
            label: "roleName",
            value: "id"
          },
        }
      ]
    },
    //添加按钮
    addBtn: {
      text: '立即添加',
      url: "API.admin_manager.add"
    },
    //编辑按钮
    editBtn: {
      text: '编辑',
      detailUrl: "API.admin_manager.detail",
      detailType: 'post',
      detailParams: {},  //这里是对象,非字符串, 只能写给定值的参数
      detailDataFormatCode: //额外的数据处理代码
        ` this.formData.pwd = "";
      `,
      editUrl: "API.admin_manager.edit",
      isSplitSearchString: "true", //是否拼接查询字符串在链接结尾
      jump: '/admin_manager_page',
    },
    //添加 编辑提交校验代码补充
    submitCheckCode: `
      if(this.formData.pwd != this.formData.comfirmPwd) {
        this.$alert("两次密码输入必须一致");
        return;
      }
    `,
    //取消按钮
    cancelBtn: { text: "取消" }, //
  },

  // //详情页面
  // detail_page: {

  // }
}
